package com.daigoudao.web.model;

import java.util.List;

import com.daigoudao.config.ConfigManager;
import com.daigoudao.util.Constants;
import com.daigoudao.util.ImageUtil;

/**
 * 用户信息对象
 * 
 * @author yangfeng
 * 
 */

public class UserModel extends BasePageModel {

	private static final long serialVersionUID = 7629319062853552986L;

	private int userid;

	private String password;

	private String newpassword;

	private String newpassword2;

	private int followId;

	private int followCount;

	private String profession;

	private String nickName;

	private String realName;

	// 默认设置为-1,当为-1时不保存到数据库
	private int sex = -1;

	private String email;

	//设置0为默认值,当为0的时候不保存到数据库
	private int userType = 0;

	private String mobile;

	private int mobileCheck;

	private int mailCheck;

	private String qqid;

	private String msnid;

	private String cantype;

	private String selfdesc;

	private String photo;// 图像

	private int order = 2;

	private int star = 1;

	private String lastIp;

	private String lastTime;

	/**
	 * 经纪人合计
	 */
	private float total;

	private int buyGoodsTotal;

	private String starImg;

	private List<CategoryModel> cateList;

	private int canBuyCount;

	private List<CanBuyModel> canByuList;

	private UserAttrModel userAttr = new UserAttrModel();

	private int categoryId;

	private int areaId;

	private long sendTime;

	private String validCode;

	private int score;

	public int getSex() {
		return sex;
	}

	public void setSex(int sex) {
		this.sex = sex;
	}

	public String getPhoto() {
		return photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}

	public String getLastTime() {
		return lastTime;
	}

	public void setLastTime(String lastTime) {
		this.lastTime = lastTime;
	}

	public String getLastIp() {
		return lastIp;
	}

	public void setLastIp(String lastIp) {
		this.lastIp = lastIp;
	}

	public int getFollowCount() {
		return followCount;
	}

	public void setFollowCount(int followCount) {
		this.followCount = followCount;
	}

	public String getProfession() {
		return profession;
	}

	private int[] arrArea;

	private int[] arrCat;

	private List<AreaModel> areaList;

	private List<CategoryModel> categryList;

	private List<CanBuyModel> canBuyList;

	public void setProfession(String profession) {
		this.profession = profession;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public int getStar() {
		return star;
	}

	public String getNewpassword() {
		return newpassword;
	}

	public void setNewpassword(String newpassword) {
		this.newpassword = newpassword;
	}

	public String getNewpassword2() {
		return newpassword2;
	}

	public void setNewpassword2(String newpassword2) {
		this.newpassword2 = newpassword2;
	}

	public void setStar(int star) {
		this.star = star;
	}

	public int getUserid() {
		return userid;
	}

	public void setUserid(int userid) {
		this.userid = userid;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public int getFollowId() {
		return followId;
	}

	public void setFollowId(int followId) {
		this.followId = followId;
	}

	public int getUserType() {
		return userType;
	}

	public void setUserType(int userType) {
		this.userType = userType;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public int getMobileCheck() {
		return mobileCheck;
	}

	public void setMobileCheck(int mobileCheck) {
		this.mobileCheck = mobileCheck;
	}

	public int getMailCheck() {
		return mailCheck;
	}

	public void setMailCheck(int mailCheck) {
		this.mailCheck = mailCheck;
	}

	public String getQqid() {
		return qqid;
	}

	public void setQqid(String qqid) {
		this.qqid = qqid;
	}

	public String getMsnid() {
		return msnid;
	}

	public void setMsnid(String msnid) {
		this.msnid = msnid;
	}

	public String getCantype() {
		return cantype;
	}

	public void setCantype(String cantype) {
		this.cantype = cantype;
	}

	public String getSelfdesc() {
		return selfdesc;
	}

	public void setSelfdesc(String selfdesc) {
		this.selfdesc = selfdesc;
	}

	public List<AreaModel> getAreaList() {
		return areaList;
	}

	public void setAreaList(List<AreaModel> areaList) {
		this.areaList = areaList;
	}

	public List<CanBuyModel> getCanBuyList() {
		return canBuyList;
	}

	public void setCanBuyList(List<CanBuyModel> canBuyList) {
		this.canBuyList = canBuyList;
	}

	/**
	 * 经纪人合计
	 * 
	 * @return
	 */
	public float getTotal() {
		return total;
	}

	public List<CategoryModel> getCateList() {
		return cateList;
	}

	public void setCateList(List<CategoryModel> cateList) {
		this.cateList = cateList;
	}

	public List<CanBuyModel> getCanByuList() {
		return canByuList;
	}

	public void setCanByuList(List<CanBuyModel> canByuList) {
		this.canByuList = canByuList;
	}

	public int getBuyGoodsTotal() {
		return buyGoodsTotal;
	}

	public void setBuyGoodsTotal(int buyGoodsTotal) {
		this.buyGoodsTotal = buyGoodsTotal;
	}

	public String getStarImg() {
		return starImg;
	}

	public void setStarImg(String starImg) {
		this.starImg = starImg;
	}

	public int getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(int categoryId) {
		this.categoryId = categoryId;
	}

	public int getAreaId() {
		return areaId;
	}

	public void setAreaId(int areaId) {
		this.areaId = areaId;
	}

	public long getSendTime() {
		return sendTime;
	}

	public void setSendTime(long sendTime) {
		this.sendTime = sendTime;
	}

	public String getValidCode() {
		return validCode;
	}

	public void setValidCode(String validCode) {
		this.validCode = validCode;
	}

	public UserAttrModel getUserAttr() {
		return userAttr;
	}

	public void setUserAttr(UserAttrModel userAttr) {
		this.userAttr = userAttr;
	}

	public int getCanBuyCount() {
		return canBuyCount;
	}

	public void setCanBuyCount(int canBuyCount) {
		this.canBuyCount = canBuyCount;
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public List<CategoryModel> getCategryList() {
		return categryList;
	}

	public void setCategryList(List<CategoryModel> categryList) {
		this.categryList = categryList;
	}

	public int[] getArrArea() {
		return arrArea;
	}

	public void setArrArea(int[] arrArea) {
		this.arrArea = arrArea;
	}

	public int[] getArrCat() {
		return arrCat;
	}

	public void setArrCat(int[] arrCat) {
		this.arrCat = arrCat;
	}

	public int getOrder() {
		return order;
	}

	public void setOrder(int order) {
		this.order = order;
	}

	public String getPhotoUrl() {
		if (photo == null || "".equals(photo)) {
			photo = Constants.DEFAULT_HEAD;
		}
		return ConfigManager.getConfigString("upload.resUrl") + photo;
	}
	
	public String getPhotoUrl50() {
		String photoPath = null;
		if (photo == null || "".equals(photo)) {
			photoPath = Constants.DEFAULT_HEAD;
		}else{
			photoPath = ImageUtil.getImageFileName(photo,50);
		}
		return ConfigManager.getConfigString("upload.resUrl") + photoPath;
	}
	
	public String getPhotoUrl120() {
		String photoPath = null;
		if (photo == null || "".equals(photo)) {
			photoPath = Constants.DEFAULT_HEAD;
		}else{
			photoPath = ImageUtil.getImageFileName(photo,120);
		}
		return ConfigManager.getConfigString("upload.resUrl") + photoPath;
	}
	
	
	public static void main(String[] args) {
		System.out.println(Integer.MAX_VALUE);
	}
}
